package org.nuplay;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;

public class FFTCanvas extends JComponent {
	private float[] values;
	
	public void paint(Graphics g) {
		g.setColor(Color.RED);
		if (values != null) {
		for(int i = 0; i < values.length; i++) {
			int value = Math.round(values[i] / 5);
				g.fillRect(20 * i, 0, 20, value);
		}
		}
	}
	
	public void setValues(float[] in_values) {
		values = in_values;
		repaint();
	}
}
